package com.itheima.mapper;

import com.itheima.pojo.Friend;
import com.itheima.pojo.Group;
import com.itheima.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 员工管理
 */
@Mapper
public interface UserMapper {

    @Select("select user_id from user where user_name = #{userName} and user_pwd = #{userPwd}")
    Integer login(String userName, String userPwd);

    @Insert("insert into user(user_name, user_pwd) " + " values(#{userName},#{userPwd})")
    void register(String userName, String userPwd);


    @Select("select user_avatar from avatar where user_name = #{name}")
    String getAvatarByName(String name);


    @Update("update avatar set user_avatar = #{userAvatar} where user_name = #{userName}")
    void updateAvatar(String userName, String userAvatar);

    @Insert("insert into avatar (user_name,user_avatar) " + " values(#{userName},#{userAvatar})")
    void insertAvatar(String userName, String userAvatar);

    @Select("select * from user where user_name = #{userName}")
    User getUserByName(String userName);

}
